<?php
/**
 *  
 * @package package_name
 * @author Mervin.Wong<mervin0502@163.com>
 * @copyright
 * @license  http://www.apache.org/licenses/LICENSE-2.0
 * @version 0.1.0
 * @date 2013-3-2下午9:31:32
 *
 */
 
 /**
  * CanGoo Widget library
  * 博客挂件
  */
  
 class Widget{
 	
 	public function __construct(){
 		
 	}
 	
 	public function plugin($plugin_name, $plugin_params){
 		require_once(dirname(__FILE__).'/../../plugins/'.$plugin_name.'.class.php');
 		$class_name = ucfirst($plugin_name);
 		$obj = new $class_name();
 		if(count($plugin_params) > 0){
	 		foreach($plugin_params as $k=>$v){
	 			$obj->__set($k, $v);
	 		}
 		}
 		return $obj->run();
 	}
 }
